package org.devknights.android.andlib.sms;

import android.database.Cursor;

public class SMSReader {

	private Cursor cur;

	public SMSReader(Cursor cur) {
		this.cur = cur;
		if (cur.getPosition() < 0 && cur.getCount() > 0) {
			cur.moveToFirst();
		}
	}

	public boolean hasNext() {
		return cur.getPosition() < cur.getCount();
	}

	public int colCount() {
		return cur.getColumnCount();
	}

	public String getColName(int i) {
		return cur.getColumnName(i);
	}

	public String getString(int i) {
		return cur.getString(i);
	}

	public String getString(String name) {
		return cur.getString(cur.getColumnIndex(name));
	}

	public void next() {
		cur.moveToNext();
	}

}
